import os
from celery import Celery
# 设置django环境变量
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'meiduo_mall.settings')
# 创建celery实例
app = Celery('celery_tasks')

app.config_from_object('celery_tasks.config')

# 自动发现任务
app.autodiscover_tasks(['celery_tasks.sms', 'celery_tasks.email'])